package com.flainsky.nirvanaplayer.globe;

import android.content.Context;
import android.widget.Toast;

public class ToastMaker {
private static Toast toast;
	
	public static void showToastLong(Context context,String text)
	{
		showToast(context,text,Toast.LENGTH_LONG);
	}
	
	public static void showToastLong(Context context,int textID)
	{
		showToast(context,context.getString(textID),Toast.LENGTH_LONG);
	}
	
	public static void showToastShort(Context context,String text)
	{
		showToast(context,text,Toast.LENGTH_SHORT);
	}
	
	public static void showToastShort(Context context,int textID)
	{
		showToast(context,context.getString(textID),Toast.LENGTH_SHORT);
	}
	
	private static void showToast(Context context,String text,int duration)
	{
		if(toast == null)
		{
			toast = Toast.makeText(context, text,duration);
		}
		toast.setDuration(duration);
		toast.setText(text);
		toast.show();
	}
}
